<p-panel header="筛选查询" [collapsed]="false" headerClass="bg-eaeaea border-none" search="延期单号/项目编号/客户姓名/项目经理" (onSearch)=" normalSearchFun();dt.reset()"
         [(searchText)]="searchObj.searchValue" maxlength="20">
  <div class="p-b-20 border-b-d9d9d9">
    <p-selectButton [canDelete]="true" [options]="status" optionLabel='name' (onChange)="normalSearchFun();dt.reset()" [(ngModel)]="selectStatus"></p-selectButton>
  </div>
  <div class="p-t-20 clearfix">
    <div class="m-r-15 inline-block1 org">
      <span class="opacity06">组织名称：</span>
      <div class="inline-block">
        <p-treeselect [value]="organizationArray" styleClass="width-150" [filter]="true" placeholder="全部" selectionMode="single"
                      [(selection)]="seletcedOrganization" (selectionChange)="normalSearchFun()"></p-treeselect>
      </div>
    </div>
    <div class="inline-block">
      <span class="p-r-10 opacity06">责任类型：</span>
      <p-dropdown placeholder="全部" styleClass="width-150 m-r-30" [options]="dutyType" [(ngModel)]="selectDutyType" [ngModelOptions]="{standalone: true}"
                  optionLabel="name" (onChange)='changeDutyType();normalSearchFun();dt.reset();'></p-dropdown>
    </div>
    <div class="inline-block">
      <span class="p-r-10 opacity06">延期理由：</span>
      <p-dropdown placeholder="全部" styleClass="width-150 m-r-30" [options]="delayReason" [(ngModel)]="selectDelayReason" [ngModelOptions]="{standalone: true}"
                  optionLabel="name" [title]="selectDelayReason.name" (onChange)='normalSearchFun();dt.reset();'></p-dropdown>
    </div>

    <div class="inline-block pull-right">
      <button pButton type="button" (click)="normalSearchFun();dt.reset()" label="查询" class="btn btn-success m-r-10"></button>
    </div>
  </div>
</p-panel>


<p-dataTable #dt scrollable="true" [value]="listData" [totalRecords]="totalRecords" [lazy]="true" [marginHeight]="20" (onLazyLoad)="onPage($event)"
             [paginator]="true" [headerCheckboxToggleAllPages]="true" >
  <p-header>
  </p-header>
  <p-column *ngFor="let col of dataHead" [field]='col.field' [header]='col.header' [hidden]="col.hidden" [sortable]="col.sortable"
            [style]="{'width':col.width}">
    <ng-template let-index='rowIndex' let-data='rowData' pTemplate='body' *ngIf="col.tem">
      <div *ngIf="col.field === 'code'">
        <a class="color-1a91eb" [title]="data[col.field]" target="_blank" [routerLink]="['/saas/engineer/constructionprocess/delaymanage', data.id]">
          {{data.code}}
        </a>
      </div>
      <div *ngIf="col.field === 'organizationCode'">
          {{storage.orgFilter(data.organizationCode)}}
      </div>
      <div *ngIf="col.field === 'delayResponsibilityType'">
        {{storage.dicFilter('responsibilitytype',data.delayResponsibilityType)}}
      </div>
      <div *ngIf="col.field === 'delayReason' && data.delayResponsibilityType">
        {{data.delayResponsibilityType == 'responsibilitytype_180208000001' ? storage.dicFilter('customdelayreason',data.delayReason) : storage.dicFilter('notcustomdelayreason',data.delayReason)}}
      </div>
      <div *ngIf="col.field === 'status'">
        {{storage.dicFilter('delaystatus',data.status)}}
      </div>
      <div *ngIf="col.field === 'foreman'">
        {{(data.creater && data.userTelePhone) ? data.creater +" "+ data.userTelePhone : ''}}
      </div>
    </ng-template>
  </p-column>
</p-dataTable>

